cmake_minimum_required(VERSION 2.8)
project(DBoW2)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  -Wall  -O3 -march=native ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -O3 -march=native")

set(SRCS_DBOW2_DIR ${PROJECT_SOURCE_DIR}/src)
set(SRCS_DBOW2_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include/DBoW2)

set(SRCS_DBOW2
    ${SRCS_DBOW2_DIR}/BowVector.cpp
    ${SRCS_DBOW2_DIR}/FBrief.cpp
    ${SRCS_DBOW2_DIR}/FeatureVector.cpp
    ${SRCS_DBOW2_DIR}/FORB.cpp
    ${SRCS_DBOW2_DIR}/FSurf64.cpp
    ${SRCS_DBOW2_DIR}/QueryResults.cpp
    ${SRCS_DBOW2_DIR}/ScoringObject.cpp
)
find_package(OpenCV 4 QUIET)

# set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${SRCS_DBOW2_INCLUDE_DIR})

add_library(DBoW2 SHARED ${SRCS_DBOW2})
target_link_libraries(DBoW2 ${OpenCV_LIBS})

